import 'whatwg-fetch';
import URLSearchParams from 'url-search-params';
import queryString from 'query-string';
// import roomShow from './roomShow';
import roomShare from './roomShare';
import roomShareTwo from './roomShareTwo'
import roomDetails from './roomDetails'

global.queryString = queryString;
global.URLSearchParams = URLSearchParams;

const config = {
  // agentSystem: 'http://c-c.jiahuagame.com/lefantian-console/console/disp/',
  // roomSystem: 'http://10.10.10.188:8080/game-lobby/Room/room/11111/2',
  // roomSystem: 'http://lefantian.jiahuagame.com',
  roomSystem: 'https://c-c.jiahuagame.com',
  // roomSystem: 'http://c-c.jiahuagame.com/game-lobby/Room/room/11111/2',
  // appId: 'http://lefantian.jiahuagame.com/game-lobby'
  // appId: 'http://c-c.jiahuagame.com/game-lobby'
  // roomSystem: 'http://10.10.10.188:8080',
};

// if (window.location.hostname.match(/10.10.10/)) {
//   config.roomSystem = 'http://10.10.10.155:8080'
// } else if (window.location.hostname.match(/lefantian/)) {
//   config.roomSystem = 'http://lefantian.jiahuagame.com'
// } else {
//   config.roomSystem = 'http://c-c.jiahuagame.com'
// }

const api = {
  // roomShow: roomShow(config),
  roomShare: roomShare(config),
  roomShareTwo: roomShareTwo(config),
  roomDetails: roomDetails(config),
};

export default api;